﻿using JESAI.EventBus.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JESAI.EventBus.ExcutedResults
{
    public class EventHandleResult : EventArgs
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="eventSource">事件源（事件承载对象）</param>
        /// <param name="success">任务处理委托调用结果</param>
        public EventHandleResult(IEvent @event, EventHandleResultType eventHandleResultType)
        {
            Event = @event;
            Status = eventHandleResultType;
        }

        public IEvent Event { get; }

        public EventHandleResultType Status { get; }

        /// <summary>
        /// 异常信息
        /// </summary>
        public Exception Exception { get; internal set; }
    }

    public enum EventHandleResultType
    {
        Success,
        Fail
    }
}
